<? echo $this->render("header_news.phtml"); ?>
<?php $utilities = $this->utilities; ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
  	<td width="25%" align="left" valign="top">
  		<?php echo $this->render('box_vip_news.phtml', null, true); ?>
  		<p style="margin: 0; padding: 9px 0 0 0;"><img src="<?= $this->baseUrl ?>/public/images/frontend/pixel.gif" height="3" /></p>
  		<?php echo $this->render('box_tophit.phtml', null, true); ?>
  	</td>
    <td width="43%" align="left" valign="top" style="padding: 0 15px 0 15px;">
    	<p style="font-size: 15pt; padding: 0 0 0 0">
    		<?= 'TIN EWAY' ?>
    	</p>
    	<p class="horiz_sep">&nbsp;</p>
		<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<?php
				$index = 0;
				foreach ($this->listArticles as $article) {
					$article_title = $utilities->cv2urltitle(htmlspecialchars (trim($article->art_title)));	
					$param = str_ireplace(" ", "-", trim($article_title))."/".date('Y')."/".date('m')."/".$article->art_id.""."-".$this->currentPage.".top";
			?>
			<tr>
				<td class="art_sep" style="padding: 10px 0 10px 0; line-height: 150%;" width="100%">
		    		<p style="margin: 0px; padding: 0 0 10px 0;">
			    		<a class="news_title" style="<?= ($index == 0) ? 'color: #ff7300; font-family: arial, tahoma; font-size: 15pt' : 'font-size: 11pt' ?>" href="<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/view/<?php echo $param;?>">
			    			<?php echo $article->art_title;?>
			    		</a>
		    		</p>
	
	  				<p style="font-family: tahoma, arial, verdana; font-size: 9pt; text-align: justify;">
	  				<?php 
	  					if ($article->art_has_image){
	  						if (strlen($article->art_image)){
	  				?>
		  				
		  					<img style="border:1px solid #cecece; padding:1px;" align="<?= ($index % 2 != 0) ? 'left' : 'right' ?>" width="100" height="100" vspace="5" hspace="8" src="<?php echo $this->baseUrl;?>/public/images/article/<?php echo $article->art_image;?>"/>
		  				
	  				<?php 
	  						}
	  					} 
	  				?>				
	  					<?php if ($article->art_lead) echo $utilities->substring($article->art_lead);?>
	  				</p>
				</td>
			</tr>
			<?php
					$index ++;
				}
			?>
			<tr>
				<td align="center" style="padding: 10px 0 0 0;">
					<?php echo $this->page; ?>
				</td>
			</tr>
			
			<?php 
				if (isset($this->list_new)){
					if ($this->list_new){ 
			?>
			<tr>
				<td width="100%" align="left">
					<b>Các tin mới hơn</b>
				</td>
			</tr>
			<tr>
				<td width="100%" align="left">
					<table cellpadding="0" cellspacing="5" width="100%" border="0">
						<?php 
							foreach ($this->list_new as $article) {
								$article_title = $utilities->cv2urltitle(htmlspecialchars (trim($article->art_title)));	
								$param = str_ireplace(" ", "-", trim($article_title))."/".date('Y')."/".date('m')."/".$article->art_id.""."-".$this->currentPage.".top"; 
						?>
							<tr>
								<td width="100%" align="left">
									<a class="news_title" href="<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/view/<?php echo $param;?>">
										<?php echo trim($article->art_title); ?>
									</a>
								</td>
							</tr>
						<?php 
							}
						?>
					</table>
				</td>
			</tr>
			<?php 
					}
				} 
			?>
			
			<?php 
				if (isset($this->old_articles)){
					if ($this->old_articles){ 
			?>
			<tr>
				<td width="100%" align="left">
					<b>Các tin cũ hơn</b>
				</td>
			</tr>
			<tr>
				<td width="100%" align="left">
					<table cellpadding="0" cellspacing="5" width="100%" border="0">
						<?php 
							foreach ($this->old_articles as $article) {
								$article_title = $utilities->cv2urltitle(htmlspecialchars (trim($article->art_title)));	
								$param = str_ireplace(" ", "-", trim($article_title))."/".date('Y')."/".date('m')."/".$article->art_id.""."-".$this->currentPage.".top"; 
						?>
							<tr>
								<td width="100%" align="left">
									<a class="news_title" href="<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/view/<?php echo $param;?>">
										<?php echo trim($article->art_title); ?>
									</a>
								</td>
							</tr>
						<?php 
								//}
							} 
						?>
					</table>
				</td>
			</tr>
			<?php 
					}
				} 
			?>
		</table>
    </td>
    <td width="32%" align="left" valign="top">
    	<?php echo $this->render('box_reg_now.phtml', null, true); ?>
    	<p style="width: 100%; height: 5px;">&nbsp;</p>
    	<?php echo $this->render('box_news_ads.phtml', null, true); ?>
    </td>
  </tr>
</table>
<? echo $this->render("footer.phtml"); ?>